Skip to content

Conversation

unknownpanic
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

All core requirements are fully met: Machine is abstract with the required public abstract methods, Truck/Bulldozer/Excavator correctly extend and override them, and MainApp demonstrates polymorphism by iterating a Machine[] and calling doWork()/stopWork(). Functionality compiles and runs; no blockers or broken behavior detected.

However, there are minor checklist style issues with redundant empty lines that you should fix next:

  • Machine.java: remove the blank line after the package (line 2) and the blank line between the two abstract method declarations (around line 5).
  • Truck.java: remove the blank line after the package and the blank line between doWork() and @Override of stopWork().
  • Excavator.java: remove the blank line between the closing brace of doWork() and the @Override of stopWork() (currently around line 8).
  • MainApp.java: remove the unnecessary blank lines inside main.

Optional polish: unify punctuation/phrasing in Bulldozer messages (avoid double dots and add a period to stopWork()), and consider using an enhanced for-loop in MainApp. Nice work overall—just tidy the whitespace to align with the checklist.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

public void doWork() {
System.out.println("Excavator is started working...");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the checklist item: "Please don't add redundant empty lines to your code.\nWe don't need them after class declaration or method signature." Remove the blank line between the closing brace of doWork() and the @Override of stopWork() so the methods follow one another without an extra empty line (the blank is currently on line 8). See checklist for guidance .

@@ -0,0 +1,7 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has a redundant empty line between the package statement and the class declaration. The checklist explicitly says: "Please don't add redundant empty lines to your code." Consider removing this blank line so the class declaration immediately follows the package line. See checklist: "Please don't add redundant empty lines to your code."


public abstract class Machine {
public abstract void doWork();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line between the two abstract method declarations is redundant. The checklist guidance states: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove this blank line so the method declarations are adjacent and follow the style guidance .

Machine truck = new Truck();
Machine bullDozer = new Bulldozer();
Machine excavator = new Excavator();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Violation — redundant empty line
This line is an unnecessary blank line inside the main method. It violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Consider removing this blank line to match the project style guidelines.

Machine excavator = new Excavator();

Machine[] arrayOfMachines = {truck, bullDozer, excavator};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Violation — redundant empty line
This line is another unnecessary blank line inside the main method. It also violates: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove this blank line to comply with the checklist.

@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains an extra blank line immediately after the package declaration. The project checklist says: "Please don't add redundant empty lines to your code." Removing this blank line will make the file consistent with the style guidance and examples in the checklist. See checklist: "We don't need them after class declaration or method signature."

public void doWork() {
System.out.println("Truck is started working...");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a redundant empty line between the end of doWork() and the next @Override. The checklist warns: "We don't need them after class declaration or method signature." Consider removing this blank line so method blocks follow one another directly, matching the recommended style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants